home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16957 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: nntp.uio.no!solace!user
  2. From: lars.farm@nts.mh.se (Lars Farm)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Why don't you use garbage collection
  5. Date: Sat, 13 Apr 1996 00:34:44 +0200
  6. Organization: pv
  7. Message-ID: <AD94A724966833CA@dialup97-6-14.swipnet.se>
  8. References: <4kiai0$mjd@dfw-ixnews8.ix.netcom.com>
  9. NNTP-Posting-Host: dialup97-6-14.swipnet.se
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-1
  12. Content-Transfer-Encoding: 8bit
  13.  
  14. In article <4kiai0$mjd@dfw-ixnews8.ix.netcom.com>,
  15. giuliano@ix.netcom.com(Giuliano Carlini) wrote:
  16.  
  17. >What follows is my belief for why garbage collection is so little used.
  18. >Feel free to respond to anything I say below, but please, first respond
  19. >to the questions above. I believe that most people don't use garbage
  20. >collection because either they:
  21. >    - don't know what it is
  22. >    - don't know it can be used with C/C++.
  23. >    - are misinformation
  24. >    - are biased against it by the C/C++ culture
  25.  
  26. No. More like:
  27.  - not sanctioned -> Can't trust the library to work with another compiler
  28. or even a later version of my current compiler. I'd like it in the standard
  29. as an option, a new storage class. Like stack-based objects, heap-based
  30. objects and add GC-based objects.
  31.  - there is the problem of destructors that release other resources than
  32. memory.
  33.  
  34. >So, do you use garbage collection in your C/C++ programs, and if not,
  35. >why not?
  36.  
  37. I do use GC (Boehms collector) but only in my own programs, never in
  38. programs written for others because of the potential portability problems
  39. and because my code must coexist with code written by others. GC in the
  40. standard would solve that problem. It has been mentioned here that the
  41. committee was initially supposed to consider templates, exceptions and GC.
  42. It appears they never got to the GC part. Judging by discussions here and
  43. in c.std.c++ they're not particularly interested either. Cultural clash I
  44. suppose. Pity. Even an minimalistic and optional language feature that
  45. describes what GC should do if present would be better than no description.
  46.  
  47.  
  48.  
  49.